package gameobjects;

/**
 *
 * Author: Gunnar Sigurðsson
 * Date: 11/21/12
 * Time: 8:07 PM
 */

/**
 * The Checkmark object contains all information stored in a single slot in
 * the game board.
 */
public class Checkmark {
    /**
     *  The Player's mark. Usually an 'X' or an 'O'.
     */
    private char mark;
    /**
     * Indicates whether the slot is occupied or not.
     */
    private boolean isChecked;
    /**
     * The value assigned to the slot. It can range from 1-9.
     */
    private int value;

    /**
     * Initalizes a Checkmark object with empty values. By default the mark is
     * empty and the slot is not checked.
     * @param pValue The value assigned to the slot. It can range from 1-9.
     */
    public Checkmark(final int pValue) {
        this.value = pValue;
        this.mark = ' ';
        this.isChecked = false;
    }

    /**
     * If marker is checked the returns true else false.
     * @return boolean
     */
    public final boolean isChecked() {
        return isChecked;
    }

    /**
     * Sets the pMark to mark and sets isChecked to true.
     * @param pMark Character is set to mark
     */
    public final void setChecked(final char pMark) {
        this.mark = pMark;
        isChecked = true;
    }

    /**
     * Returns the mark.
     * @return char
     */
    public final char getMark() {
        return mark;
    }

    /**
     * Returns the value.
     * @return int
     */
    public final int getValue() {
        return value;
    }
}
